package com.cc.user.service.impl;

import com.cc.user.entity.UserEntity;
import com.cc.user.vo.*;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.cc.user.dao.EmployeeCustomerDao;
import com.cc.user.entity.EmployeeCustomerEntity;
import com.cc.user.service.EmployeeCustomerService;


@Service("employeeCustomerService")
public class EmployeeCustomerServiceImpl extends ServiceImpl<EmployeeCustomerDao, EmployeeCustomerEntity> implements EmployeeCustomerService {


    @Override
    public UserEntity getEmployee(Long uid) {
        EmployeeCustomerDao employeeCustomerDao = this.baseMapper;
        UserEntity userEntity = employeeCustomerDao.selectByCid(uid);
        return userEntity;
    }

    @Override
    public List<CustomerVo> getAllCustomers(Long eid) {
        EmployeeCustomerDao employeeCustomerDao = this.baseMapper;
        return employeeCustomerDao.getAllCustomers(eid);
    }

    @Override
    public CustomerDetailVo getCustomerDetailByCid(Long cid) {
        EmployeeCustomerDao employeeCustomerDao = this.baseMapper;
        return employeeCustomerDao.getCustomerDetailByCid(cid);
    }

    @Override
    public List<CustomerVo> getCustomersByPhoneOrName(Long eid, String condition) {
        EmployeeCustomerDao employeeCustomerDao = this.baseMapper;
        return employeeCustomerDao.getCustomersByPhoneOrName(eid,condition);
    }

    @Override
    public List<EmployeeCustomerVo> getEmployeesCustomers(String empMobile, String cusMobile) {
        EmployeeCustomerDao employeeCustomerDao = this.baseMapper;
        return employeeCustomerDao.getEmployeesCustomers(empMobile,cusMobile);
    }

    @Override
    public List<OfflineOrderNewVo> getCustomerDetailByEidCid(Long eid, Long cid) {
        EmployeeCustomerDao employeeCustomerDao = this.baseMapper;
        return employeeCustomerDao.getCustomerDetailByEidCid(eid, cid);
    }

    @Override
    public List<OfflineOrderProductNewVo> getOfflineOrderProductsById(Long ooid) {
        EmployeeCustomerDao employeeCustomerDao = this.baseMapper;
        return employeeCustomerDao.getOfflineOrderProductsById(ooid);
    }
}